# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-lnkparse3
_pkgname=LnkParse3
pkgver=1.5.2
_pyver=3.13
pkgrel=1
pkgdesc='Windows Shortcut file (LNK) parser.'
arch=('any')
url='https://pypi.org/project/LnkParse3/'
license=('MIT')
depends=('python')
makedepends=('python-pip' 'python-build' 'python-wheel')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6e01142e26e7436ec859f894a8945b193d4d5cf8832e6f9fd3787d17dcd8be097be94c02d478b34277f0291280b758b39a2454ad52baf89d00ebf8c3405b0800')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  rm -rf "$pkgdir/usr/lib/python${_pyver}/site-packages/tests/"
}

